#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=5e5+100;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
vector<LL>g[maxn];
struct P{
    LL val,id;
    friend bool operator <(struct P a,struct P b){
        return a.val<b.val;
    }
}a[maxn];
LL ans[maxn],col[maxn];
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  LL n,m;cin>>n>>m;
  for(LL i=1;i<=m;i++){
      LL u,v;cin>>u>>v;
      g[u].push_back(v);g[v].push_back(u);
  }
  for(LL i=1;i<=n;i++) cin>>a[i].val,a[i].id=i;
  sort(a+1,a+1+n);
  /*
  for(LL i=1;i<=n;i++){
    cout<<a[i].val<<" "<<a[i].id<<"\n";

  }*/

  LL cnt=0;
  for(LL i=1;i<=n;i++){
     LL u=a[i].id;
     LL val=a[i].val;
     col[u]=val;
     ans[++cnt]=u;
     multiset<LL>s;
     for(LL j=0;j<g[u].size();j++){
         LL v=g[u][j];
         if(col[v]) s.insert(col[v]);
     }
     if(s.count(val)){
        cout<<"-1"<<"\n";
        return 0;
     }
     for(LL k=1;k<val;k++){
        if(!s.count(k)){
            cout<<"-1"<<"\n";
            return 0;
        }
     }
  }
  for(LL i=1;i<=cnt;i++){
    cout<<ans[i]<<" ";
  }
  cout<<"\n";
return 0;
}
